package com.vegas.netspider.visitor;

import java.sql.SQLException;

import com.vegas.netspider.ApplicationContext;
import com.vegas.netspider.apps.SpiderMan;

public class NetController implements NetControl {
	
	private SpiderMan spiderMan;
	private ApplicationContext context;

	@Override
	public void shutdown() {
		spiderMan.shutdown();
	}

	@Override
	public void start() throws Exception {
		spiderMan.init();
	}

	@Override
	public void reset(String url, String name, String password) throws Exception {
		spiderMan.shutdown();
		
		context.setDomainUrl(url);
		context.setPassword(password);
		context.setUsername(name);
		
		spiderMan.init();
	}

	public void setSpiderMan(SpiderMan spiderMan) {
		this.spiderMan = spiderMan;
	}

	
}
